<!-- 设备维修记录 -->
<template>
	<view class="page">
		<template v-if="token&&isLogin">
			<view class="h45 m-b2">
				<view class="fix-wrap limit-tab">
					<view class="item active">
						<view class="name">全部记录</view>
						<view class="active-line"></view>
					</view>
					<view class="item">
						<view class="name">维修中</view>
						<view class="active-line"></view>
					</view>
					<view class="item">
						<view class="name">已完成</view>
						<view class="active-line"></view>
					</view>
				</view>
			</view>
			<view class="body">
				<template v-if="!loadingState.default">
					<template v-if="!isEmpty">
						<view class="list">
							<view class="order-item" v-for="(item,index) in 10" :key="index">
								<view class="hd">
									<view class="order-number">维修单号：1321546445645</view>
									<view class="state">维修中</view>
								</view>
								<view class="dev-info">
									<view class="pic">
										<image src="" mode="widthFix"></image>
									</view>
									<view class="info">
										<view class="dev-name">智能风吸式杀虫灯</view>
										<view class="text">维修师傅：张三</view>
										<view class="text">维修时间：2020-03-20</view>
									</view>
								</view>
							</view>
						</view>
						<loading :loadingState="loadingState"></loading>
					</template>
					<empty v-else>
						<view slot="text">没有相关信息</view>
					</empty>
				</template>
				<template v-else>
					<loading :loadingState="loadingState"></loading>
				</template>
			</view>
		</template>
	</view>
</template>

<script>
	import loading from '@/components/loading-more.vue'
	export default {
		name: '',
		data() {
			return {
				appid: getApp().globalData.appid,
				token: uni.getStorageSync('token'),
				isLogin:false,
				params: {
					number: '',
					page: '',
					limit: 10
				},
				loadingState: {
					default: false,
					loading: false,
					completed: false
				}
			}
		},
		onload() {

		},
		onshow() {

		},
		methods: {

			getListReportInfo: async function() {
				let res = await this.$api.tool_api.getListReportInfo({

				})
			}
		},
		computed: {

		},
		components: {
			loading
		},
	}
</script>

<style lang="less">
	.limit-tab {
		background: #fff;
	}

	.list {
		.order-item {
			margin-bottom: 20rpx;
			background: #fff;
		}
	}

	.order-item {
		margin-bottom: 20rpx;
		padding-left: 20rpx;
		background: #fff;

		.hd {
			display: flex;
			justify-content: space-between;
			padding-right: 20rpx;
			line-height: 80rpx;
			border-bottom: 2rpx solid #eee;
			font-size: 28rpx;

			.order-number {}

			.state {
				color: #FF4343;
			}
		}

		.dev-info {
			display: flex;
			padding: 20rpx 20rpx 20rpx 0;

			.pic {
				width: 25%;
				max-height: 140rpx;
				margin-right: 20rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				flex-shrink: 0;
				overflow: hidden;

				image {
					width: 100%;
				}
			}

			.info {
				flex-grow: 2;

				.dev-name {
					margin-bottom: 10rpx;
					font-size: 30rpx;
					font-weight: bold;
				}

				.text {
					margin-bottom: 10rpx;
					font-size: 28rpx;
					color: #999;
				}
			}
		}
	}
</style>
